<div class="course-list-header box clearfix">
    <div class="summary pull-left"><strong><?php echo $total ?></strong> total messages</div>
    <div class="sort pull-right">                                
        <label class="control-label pull-left">Sort by: </label>
        <select class="sort-options form-control pull-left">
            <option>Date</option>
            <option>Read Status</option>
            <option>Username</option>
        </select>                                  
    </div><!--//sort-->
</div>
<div class="course-item-header row-divider hidden-sm hidden-xs">
    <div class="row">
        <div class="col-title col-md-4 col-sm-6"><strong>Title</strong></div>
        <div class="col-meta col-md-8 col-sm-6">
            <div class="row">
                <div class="col-start col-md-3"><strong>Date</strong></div>                                    
                <div class="col-duration col-md-2"><strong>From</strong></div> 
            </div>                                 
        </div><!--//col-meta-->    
    </div><!---//row-->                            
</div>
<article class="course-item row-divider">   
    <?php foreach($messages as $message) { ?>
    <div class="details row">
        <div class="col-title col-md-4 col-sm-6">
            <a href="<?php echo base_url() . 'messages/read/' . $message->id ?>">
                <?php echo $message->title; ?>
            </a> 
            <?php if($message->is_read == 0) { ?>
                <span class="label label-success">New</span>
            <?php } ?>
        </div>
        <div class="col-meta col-md-8 col-sm-6">
            <div class="row">
                <div class="col-start col-md-3"><?php echo $message->time; ?></div>                                    
                <div class="col-duration col-md-2"><?php echo $message->sender_username; ?></div>
            </div>                                 
        </div><!--//col-meta-->                           
    </div><!--//details-->
    <?php } ?>
</article>